package autoTest.device;
/**
 * 测试平台类型
 * @author HYW
 *
 */
public enum Platform {
	ANDROID(0, "Android"),			//android 手机端
	IOS(1, "iOS"),				//ios 手机端
	WINDOWS(2, "Windows")			//windows PC端
	;
	
	private int value;
	private String valueStr;

	Platform(int value, String str) {
		this.value = value;
		this.valueStr = str;
	}
	
	public Platform valueOf(int value) {
		switch(value) {
		case 0:
			return ANDROID;
		case 1:
			return IOS;
		case 2:
			return WINDOWS;
		default:
			return null;
		}
	}
	
	public static Platform valueStrOf(String valueStr) {
		if (valueStr == null) {
			return null;
		}
		if (valueStr.equals(ANDROID.valueStr)) {
			return ANDROID;
		} else if (valueStr.equals(IOS.valueStr)) {
			return IOS;
		} else if (valueStr.equals(WINDOWS.valueStr)) {
			return WINDOWS;
		} else {
			return null;
		}
	}
	
	public int value() {
		return this.value;
	}
	
	public String valueStr() {
		return this.valueStr;
	}
}
